import { addDateRange, handleTree, parseTime, selectDictLabel, selectDictLabels, useDict } from '@/utils/ruoyi.ts';
import { systemDictDataService } from '@great/services';
import modal from './modal';
// 预设动画
import animate from '@/utils/animate.ts';
import type { App } from 'vue';

export function setupPlugin(app: App) {
    // 全局方法挂载
    app.config.globalProperties.getConfigKey = systemDictDataService.getConfigKey;
    app.config.globalProperties.updateConfigByKey = systemDictDataService.updateConfigByKey;
    app.config.globalProperties.useDict = useDict;
    app.config.globalProperties.parseTime = parseTime;
    app.config.globalProperties.handleTree = handleTree;
    app.config.globalProperties.addDateRange = addDateRange;
    app.config.globalProperties.selectDictLabel = selectDictLabel;
    app.config.globalProperties.selectDictLabels = selectDictLabels;
    app.config.globalProperties.animate = animate;
    // 模态框对象
    app.config.globalProperties.$modal = modal;
}
